﻿#region Using Directives

using System;

#endregion

namespace GeekRule.ORM.Entities
{
    /// <summary>
    /// Indicates the data state for an entity and is used to drive persistence behavior.
    /// </summary>
    [Flags]
    public enum EntityState
    {
        /// <summary>
        /// Indicates that entity state tracking is not enabled
        /// </summary>
        NotSet = 1,

        /// <summary>
        /// New, unpersisted entity
        /// </summary>
        New = 2,

        /// <summary>
        /// Existing, persisted entity with one or more changed values
        /// so flagged to be persisted
        /// </summary>
        Dirty = 4,

        /// <summary>
        /// Existing, persisted entity that is marked for deletion but not yet
        /// deleted from the persistence store
        /// </summary>
        Deleted = 8,

        /// <summary>
        /// No values have changed since retrieved from the persistence store
        /// </summary>
        Unchanged = 16
    }
}
